<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../WEB-INF/includes/templates/templateAuthenticated.xhtml">
    <ui:define name="content">
        <style>

            .top-bar2{
                border: 1px solid #eeeeee;
            }
        </style> 
        <div id="main" >
            <br/>
            <br/>
            <br/>
            <br/>
            <h:form>
                <section  id="services" class="services" >
                    <div class="row" data-view="services">
                        <div class="small-11 large-12 small-centered columns">
                            <div class="row">
                                <div class="columns large-10 large-centered">
                                    <section  class="headline">
                                        <h2 style="text-align:left;">

                                            #{tittles['page.customerOperations.title1']}
                                        </h2>
                                        <br></br>
                                        <div>
                                            <table align="center" >
                                                <thead></thead>
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <h5 class="subheader" style="text-align:left;">
                                                                #{labels['page.customerOperations.chipnumber']}
                                                            </h5>
                                                        </td>
                                                        <td>
                                                            <h:outputText value="#{customerOperationsBean.chipAux.chipNumber}" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <h5 class="subheader" style="text-align:left;">
                                                                #{labels['page.customerOperations.inmobregistrynumber']}
                                                            </h5>
                                                        </td>
                                                        <td>
                                                            <h:outputText value="#{customerOperationsBean.chipAux.inmobRegistryNumber}" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <h5 class="subheader" style="text-align:left;">
                                                                #{labels['page.customerOperations.inmobaddressnumber']}
                                                            </h5>
                                                        </td>
                                                        <td>
                                                            <h:outputText value="#{customerOperationsBean.chipAux.inmobAddressNumber}" />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </section>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
            </h:form>

            <h:form  id="accountBalance_form">
                <div class="row">
                    <div class="columns large-10 large-centered">
                        <p:dataTable id="accountBalance_datatable" paginator="true" rows="10"  value="#{customerOperationsBean.customerBalanceList}" var="qlist"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                     rowsPerPageTemplate="5,10,15">
                            <f:facet name="header">
                                #{tittles['page.customerOperations.title2']}
                            </f:facet>

                            <p:column headerText="#{labels['page.customerOperations.projectcode']}" >
                                <h:outputText value="#{qlist.proyecto}" /> 
                            </p:column>
                            <p:column headerText="#{labels['page.customerOperations.projectname']}" >
                                <h:outputText value="#{qlist.descripc}" /> 
                            </p:column>
                            <p:column headerText="#{labels['page.customerOperations.projecdate']}" >
                                <h:outputText value="#{qlist.fechinic}" >
                                    <f:convertDateTime type="date" dateStyle="medium" ></f:convertDateTime>
                                </h:outputText> 
                            </p:column>
                            <p:column headerText="#{labels['page.customerOperations.userprojectamount']}" >
                                <h:outputText value="#{qlist.contribu}" >
                                    <f:convertNumber type="currency" currencySymbol="$" ></f:convertNumber>
                                </h:outputText> 
                            </p:column>
                            <p:column headerText="#{labels['page.customerOperations.userprojectamountdeb']}" >
                                <h:outputText value="#{qlist.valodeud}" >
                                    <f:convertNumber type="currency" currencySymbol="$" ></f:convertNumber>
                                </h:outputText> 
                            </p:column>
                            <p:column headerText="#{labels['page.customerOperations.userprojectamountback']}" >
                                <h:outputText value="#{qlist.saldfavo}" >
                                    <f:convertNumber type="currency" currencySymbol="$" ></f:convertNumber>
                                </h:outputText> 
                            </p:column>
                            <p:column headerText="#{labels['page.customerOperations.status']}" >
                                <h:outputText value="#{qlist.estado}" /> 
                            </p:column>
                            <p:column headerText="#{labels['page.customerOperations.options']}">
                                <h:commandLink rendered="#{qlist.salddeud!=0?true:false}" onclick="javascript:window.open('http://www.e-collect.com/customers/PagosIDU.htm');" >Pagar</h:commandLink>
                                <br></br>
                                <h:commandLink rendered="#{qlist.salddeud!=0?true:false}" >Descargar Factura</h:commandLink>
                                <br></br>
                                <h:commandLink rendered="#{qlist.saldfavo!=0?true:false}" action="newBackRegistry" >Registrar Devolucion</h:commandLink>
                            </p:column>
                            <f:facet name="footer">
                                #{customerOperationsBean.numberElements} #{labels['page.general.numberofrows']}
                            </f:facet>
                        </p:dataTable>
                    </div>
                </div>
            </h:form>
        </div>
    </ui:define>
</ui:composition>
